package com.test;

import java.net.*;
import java.io.*;

public class TCPClient {
	public static void main(String[] args) throws Exception {
		InetAddress ia = InetAddress.getByName("192.168.1.19");
		Socket s = new Socket("192.168.1.45", 5005, ia, 0);
		OutputStream os = s.getOutputStream();
		DataOutputStream dos = new DataOutputStream(os);
		//Thread.sleep(30000);
		//dos.writeUTF("hello server!");
		dos.write(7);
		dos.flush();
		InputStream is = s.getInputStream();
		byte[] db = new byte[1];
		is.read(db);
		System.out.println("回复：" + db[0]);
		dos.close();
		s.close();
	}
}